<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('admin_store/index')}">店铺管理</a></li>
        <li><a href="{:url('admin_store/add')}">添加店铺</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="post" action="{:url('admin_store/index')}">
        店铺名称:
        <input type="text" class="form-control" name="keyword" style="width: 200px;"
               value="{$keyword|default=''}" placeholder="请输入关键字">
        <button class="btn btn-primary">搜索</button>
    </form>
    <form class="js-ajax-form" method="post">
        <div class="table-actions">
            <button class="btn btn-danger btn-sm js-ajax-submit" type="submit" data-action="{:url('admin_store/delete')}"
                    data-subcheck="true" data-msg="{:lang('DELETE_CONFIRM_MESSAGE')}">{:lang('DELETE')}
            </button>
        </div>
        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="16">
                    <label>
                        <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
                    </label>
                </th>
                <th width="100">ID</th>
                <th>店铺名称</th>
                <th>位置</th>
                <th width="80">掌柜的</th>
                <th width="160">开店时间</th>
                <th width="80">状态</th>
                <th width="120">操作</th>
            </tr>
            </thead>
            <php>$status=array("1"=>'已发布',"0"=>'未发布');</php>
            <foreach name="store_list" item="vo">
                <php>                  
                    if($vo['status']){
                        $src=store_erweima($vo['id']);                      
                    }
                </php>
                <php>$vo['more']=json_decode($vo['more'],true);</php>
                <tr>
                    <td>
                        <input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
                               value="{$vo.id}">
                    </td>
                    <td>{$vo.id}</td>
                    <td>
                        <notempty name="vo.more.thumbnail">
                            <a href="javascript:parent.imagePreviewDialog('{:cmf_get_image_preview_url($vo.more.thumbnail)}');">
                                <i class="fa fa-photo fa-fw" style="display: block;float: left; height: 20px; line-height: 20px;"></i>
                            </a>
                        </notempty>&nbsp;
                        {$vo.store_name}
                      <php>if($vo['status']){</php>
                       <a href="javascript:parent.imagePreviewDialog('/{$src}');">
                      		<img src="/themes/Sbodycarving/public/my/img/qrcode.png" style="width: 14px;margin-left: 7px;">
                       </a>
                      <php>}</php>
                  	</td>
                    <td>{:get_city_info($vo['province_id'],$vo['city_id'],$vo['district_id'])}</td>
                    <td>{$vo.user_login}</td>
                    <td>{:date('Y-m-d H:i',$vo['store_time'])}</td>
                    <td>
                        <notempty name="vo.status">
                            审核通过
                            <else/>
                            审核中
                        </notempty>
                    </td>
                    <td>
                        <a href="{:url('admin_store/info',array('id'=>$vo['id']))}">{:lang('ADMIN_STORE_INFO')}</a>
                        <a href="{:url('admin_store/edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a>
                        <a href="{:url('admin_store/delete',array('id'=>$vo['id']))}" class="js-ajax-delete">{:lang('DELETE')}</a>
                    </td>
                </tr>
            </foreach>
            <tfoot>
            <tr>
                <th width="16">
                    <label>
                        <input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">
                    </label>
                </th>
                <th width="100">ID</th>
                <th>店铺名称</th>
                <th>位置</th>
                <th width="80">掌柜的</th>
                <th width="160">开店时间</th>
                <th width="80">状态</th>
                <th width="120">操作</th>
            </tr>
            </tfoot>
        </table>
        <div class="table-actions">
            <button class="btn btn-danger btn-sm js-ajax-submit" type="submit" data-action="{:url('admin_store/delete')}"
                    data-subcheck="true" data-msg="你确定删除吗？">{:lang('DELETE')}
            </button>
        </div>
        <div class="pagination">{$page}</div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>